﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="QuanLyQuangCao.aspx.cs" Inherits="Admin_QuanLyQuangCao" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
        .style1
        {
            width: 403px;
        }
    .style3
    {
        width: 121px;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
            <asp:GridView ID="gvQuangCao" runat="server" AutoGenerateColumns="False" Width="600px"
                BorderColor="#D2D2D2" BorderStyle="Solid" BorderWidth="1px" AllowPaging="True"
                AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaQC" 
                PageSize="5" onpageindexchanging="gvQuangCao_PageIndexChanging" 
                onselectedindexchanged="gvQuangCao_SelectedIndexChanged" 
                onrowdatabound="gvQuangCao_RowDataBound" onrowdeleting="gvQuangCao_RowDeleting">
                <Columns>
                    <asp:BoundField DataField="MaQC" HeaderText="Mã QC" SortExpression="MaQC" />
                    <asp:BoundField DataField="TenQC" HeaderText="Tên QC" SortExpression="TenQC" />
                    <asp:TemplateField HeaderText="Hình">
                        <ItemTemplate>
                            <asp:Image ID="imgQC" runat="server" Height="40px" Width="40px" 
                                ImageUrl='<%# "images/QC/"+Eval("Hinhanh") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Link" HeaderText="Link" SortExpression="Link" />
                    <asp:CommandField HeaderText="Chọn" SelectImageUrl="~/Admin/images/table/edit-icon1.png"
                        ShowSelectButton="True" SelectText="Chọn" ButtonType="Image" >
                    <ItemStyle ForeColor="Black" />
                    </asp:CommandField>
                    <asp:CommandField DeleteImageUrl="~/Admin/images/table/Capture1.PNG"
                        HeaderText="Xóa" ShowDeleteButton="True" DeleteText="Xóa" 
                        ButtonType="Image" >
                    <ItemStyle ForeColor="Black" />
                    </asp:CommandField>
                </Columns>
                <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" BorderWidth="1px"
                    Font-Bold="True" ForeColor="White" Height="50px" />
                <PagerStyle CssClass="pagerstyle" />
                <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:GridView><br />
            <asp:Button ID="btThemMoi" runat="server" Text="Thêm Mới" 
                onclick="btThemMoi_Click" />
            <br />
            <asp:Label ID="lbLoi" runat="server" ForeColor="Red"></asp:Label>
        </asp:View>
        <asp:View ID="View2" runat="server">
        <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
                <tr>
                        <td class="style3">
                            <asp:Label ID="Label1" runat="server" Text="Mã Quảng Cáo : " Font-Size="14px"></asp:Label>
                           
                        </td>
                        <td class="style1" height="38px">
                            <asp:Label ID="lbmaqc" runat="server" Font-Size="14px"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3" style="font-size: 14px">
                            Tên Quảng Cáo :&nbsp;&nbsp;
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txttenqc" runat="server" CssClass="inp-form"></asp:TextBox>                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="txttenqc" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="Hình :" Font-Size="14px"></asp:Label>
                           
                        </td>
                        <td class="style1">
                            <asp:FileUpload ID="txtimage" runat="server" />
                            <asp:RequiredFieldValidator ID="regularFileHinh3" runat="server" 
                                ControlToValidate="txtimage" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="regularFileHinh4" runat="server" 
                                ControlToValidate="txtimage" ErrorMessage="Không phải file ảnh" ForeColor="Red" 
                                ValidationExpression="^([0-9a-zA-Z_\-~ :\\])+(.jpg|.JPG|.jpeg|.JPEG|.bmp|.BMP|.gif|.GIF|.png|.PNG)$"></asp:RegularExpressionValidator>
                            <br />
                            <asp:Label ID="lbloidungluong" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3" style="font-size: 14px">
                            Link :&nbsp;&nbsp;
                        </td>
                        <td class="style1">
                            <asp:TextBox ID="txtlink" runat="server" CssClass="inp-form"></asp:TextBox>                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="txttenqc" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3" style="font-size: 14px">
                            &#7848;n/Hi&#7879;n :&nbsp;&nbsp;
                        </td>
                        <td class="style1">
                            <asp:CheckBox ID="cbAn" runat="server" Text="Hiện" BackColor="White" 
                            BorderColor="Black" ForeColor="Black" />
                        </td>
                    </tr>
                    <tr>
                        <td style="font-size: 14px" colspan="2" align="center">
                           <asp:Image ID="imgHinh" runat="server" Width="200" Height="200" />
                        <asp:HiddenField ID="hdimage" runat="server" />
                        </td>
                        
                    </tr>
                    <tr>
                        <td colspan=3 style="font-size: 14px" align="center">
                            <asp:Button ID="btthem" runat="server" Text="Thêm" OnClick="btthem_Click" />
                        <asp:Button ID="btcapnhat" runat="server" OnClick="btcapnhat_Click" 
                                Text="C&#7853;p Nh&#7853;t" />
                        </td>
                        
                    </tr>
                </table>
            

        </asp:View>
    </asp:MultiView>
</asp:Content>

